﻿<?php
/**
 * AdminController
 * 
 * @category   Longadmin
 * @package    Longadmin_Controllers
 */

class Longadmin_AdminController extends Zend_Controller_Action 
{
	/**
	 * The default action - show the home page
	 */
	protected $_PATH = "/home/vhosts/shoppingcartcnpm.orgfree.com/public/images/";
	protected $_IMAGE ;
	public function indexAction() 
	{
        if (!$this->_helper->acl('Admin')) {
            throw new SF_Acl_Exception('Access Denied');
        }
	}
	
	public function homeAction()
	{
		// phan ve Category 
		$db = Zend_Registry::get('db');
		$table = 'category';
		
		$select = $db->select()->from($table);
		$category = $db->query($select)->fetchAll();

		$this->view->category = $category;
	
		
		// phan ve Supplier
		$table = 'supplier';
		$select = $db->select()->from($table);
		$suppliers = $db->query($select)->fetchAll();
		
		//$CategoryModel = new Model_Category();
		//$category = $CategoryModel->listAllCategory();
		$this->view->suppliers = $suppliers;		
		$this->view->addSuppliersForm = $form;
		
	}



	
//////////////	/// các function để test ;
	public function testformAction()
	{
		$form = new Form_PDetailsForm();
		$form->setForm(14);
		$this->view->form = $form;
	}
	
	public function testAction()
	{
		$catdesModel = new Model_Catdes();
		$result = $catdesModel->getCatdes(30);
		$this->view->catdes = $result;
	}
	
	public function chatAction()
	{
	
	}
	
	public function windowAction()
	{
	
	}
////////////////////////////////////////////	
}
